// $Id: bloomfilter.h 54 2004-10-11 15:31:22Z jonas $
#ifndef BLOOMFILTER_H
#define BLOOMFILTER_H

#include <map>
#include <list>
//#include "routingentry.h"

class File;
class StoredFile;

/**
 * This is a stripped down version of a bloom filter. It works on stored files
 * and tries to remember them in a fuzzy way so that you can query it if a file
 * is present. If the filter says yes, the file MIGHT be present. If it says
 * no, it is definintley NOT present.
 */
class BloomFilter {
public:
	virtual ~BloomFilter() {}

	virtual BloomFilter *newCopy() = 0;
	virtual unsigned int calcDistance(unsigned int) = 0;
	virtual void update(unsigned int, std::map<File *, StoredFile *> &) = 0;
	virtual void rebuild(std::map<File *, StoredFile *> &) = 0;
	//virtual void rebuild(std::list<RoutingEntry> &) = 0;
};

#endif
